<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">

  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next-haha.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next-haha.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next-haha.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.0/css/all.min.css" integrity="sha256-VHqXKFhhMxcpubYf9xiWdCiojEbY9NexQ4jh8AxbvcM=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"ming.theyan.gs","root":"/","images":"/images","scheme":"Pisces","darkmode":false,"version":"8.25.0","exturl":false,"sidebar":{"position":"left","width_expanded":320,"width_dual_column":240,"display":"post","padding":18,"offset":12},"hljswrap":true,"codeblock":{"theme":{"light":"default","dark":"stackoverflow-dark"},"prism":{"light":"prism","dark":"prism-dark"},"copy_button":{"enable":false,"style":null},"fold":{"enable":false,"height":500},"language":false},"bookmark":{"enable":true,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"duration":200,"transition":{"menu_item":"fadeInDown","post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"top_n_per_article":1,"unescape":false,"preload":false,"trigger":"auto"}}</script><script src="/js/config.js" defer></script>

    <meta name="description" content="缘起本来这台 HP Chromebook 11A G6 EE( 加了一张 128G 的 TF 卡 )，我安装好了 Arch Linux(Xfce)，都弄好了的，但最近在知乎上老被安利说装 Debian 的 testing 版，于是我又开始折腾，把 Debian 13 testing(trixie) 安装到这台 Chromebook 上。 安装时，使用 lvm 分区不成功，系统报错：  partma">
<meta property="og:type" content="article">
<meta property="og:title" content="Chromebook 安装 Debian 12 testing">
<meta property="og:url" content="https://ming.theyan.gs/2023/10/Chromebook%20%E5%AE%89%E8%A3%85%20Debian%2012%20testing/index.html">
<meta property="og:site_name" content="运维烂笔头">
<meta property="og:description" content="缘起本来这台 HP Chromebook 11A G6 EE( 加了一张 128G 的 TF 卡 )，我安装好了 Arch Linux(Xfce)，都弄好了的，但最近在知乎上老被安利说装 Debian 的 testing 版，于是我又开始折腾，把 Debian 13 testing(trixie) 安装到这台 Chromebook 上。 安装时，使用 lvm 分区不成功，系统报错：  partma">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2023-10-14T12:33:28.000Z">
<meta property="article:modified_time" content="2023-10-27T11:46:53.000Z">
<meta property="article:author" content="老杨">
<meta property="article:tag" content="Debian">
<meta property="article:tag" content="trixie">
<meta property="article:tag" content="Chromebook">
<meta property="article:tag" content="testing">
<meta property="article:tag" content="lvm">
<meta name="twitter:card" content="summary">


<link rel="canonical" href="https://ming.theyan.gs/2023/10/Chromebook%20%E5%AE%89%E8%A3%85%20Debian%2012%20testing/">


<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://ming.theyan.gs/2023/10/Chromebook%20%E5%AE%89%E8%A3%85%20Debian%2012%20testing/index.html","path":"2023/10/Chromebook 安装 Debian 12 testing/index.html","title":"Chromebook 安装 Debian 12 testing"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>Chromebook 安装 Debian 12 testing | 运维烂笔头</title>
  
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-106574959-2"></script>
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-106574959-2","only_pageview":false,"measure_protocol_api_secret":null}</script>
  <script src="/js/third-party/analytics/google-analytics.js" defer></script>

  <script src="/js/third-party/analytics/baidu-analytics.js" defer></script>
  <script async src="https://hm.baidu.com/hm.js?fdef9ded31bdb8b2dab08eddebdd5fed"></script>







  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous" defer></script>
<script src="/js/utils.js" defer></script><script src="/js/motion.js" defer></script><script src="/js/sidebar.js" defer></script><script src="/js/next-boot.js" defer></script><script src="/js/bookmark.js" defer></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.5.0/search.js" integrity="sha256-xFC6PJ82SL9b3WkGjFavNiA9gm5z6UBxWPiu4CYjptg=" crossorigin="anonymous" defer></script>
<script src="/js/third-party/search/local-search.js" defer></script>







  




<!-- google adsense -->
<script data-ad-client="ca-pub-1045025618858716" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<link rel="alternate" href="/atom.xml" title="运维烂笔头" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <div class="column">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">运维烂笔头</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">一个 SA 老兵的工作日志</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger" aria-label="搜索" role="button">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-projects"><a href="/projects" rel="section"><i class="fa fa-code fa-fw"></i>projects</a></li><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-sitemap"><a href="/sitemap.xml" rel="section"><i class="fa fa-sitemap fa-fw"></i>站点地图</a></li><li class="menu-item menu-item-commonweal"><a href="/404/" rel="section"><i class="fa fa-heartbeat fa-fw"></i>公益 404</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
      <div class="search-header">
        <span class="search-icon">
          <i class="fa fa-search"></i>
        </span>
        <div class="search-input-container">
          <input autocomplete="off" autocapitalize="off" maxlength="80"
                placeholder="搜索..." spellcheck="false"
                type="search" class="search-input">
        </div>
        <span class="popup-btn-close" role="button">
          <i class="fa fa-times-circle"></i>
        </span>
      </div>
      <div class="search-result-container">
        <div class="search-result-icon">
          <i class="fa fa-spinner fa-pulse fa-5x"></i>
        </div>
      </div>
    </div>
  </div>

</header>
        
  
  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BC%98%E8%B5%B7"><span class="nav-number">1.</span> <span class="nav-text">缘起</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%85%B7%E4%BD%93%E6%AD%A5%E9%AA%A4"><span class="nav-number">2.</span> <span class="nav-text">具体步骤</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#ext4-%E5%9C%A8%E8%87%AA%E5%B8%A6%E5%AD%98%E5%82%A8%E4%B8%8A%E5%AE%89%E8%A3%85"><span class="nav-number">2.1.</span> <span class="nav-text">ext4 在自带存储上安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%B0%86-%E8%BF%81%E7%A7%BB%E5%88%B0-TF-%E5%8D%A1%EF%BC%88lvm%EF%BC%89"><span class="nav-number">2.2.</span> <span class="nav-text">将 &#x2F; 迁移到 TF 卡（lvm）</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E5%A4%84%E7%90%86-TF-%E5%8D%A1"><span class="nav-number">2.2.1.</span> <span class="nav-text">处理 TF 卡</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%BF%81%E7%A7%BB%E6%95%B0%E6%8D%AE%E5%88%B0-dev-vg-root-lv-root"><span class="nav-number">2.2.2.</span> <span class="nav-text">迁移数据到 &#x2F;dev&#x2F;vg_root&#x2F;lv_root</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%B0%86%E8%87%AA%E5%B8%A6%E5%AD%98%E5%82%A8%E5%8A%A0%E5%85%A5%E6%96%B0-%E5%8C%BA%E7%9A%84-lv"><span class="nav-number">2.3.</span> <span class="nav-text">将自带存储加入新 &#x2F; 区的 lv</span></a></li></ol></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">老杨</p>
  <div class="site-description" itemprop="description">好记性比不过烂笔头</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">114</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">509</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <a href="https://github.com/haw-haw" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;haw-haw" rel="noopener me" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:blog@theyan.gs" title="E-Mail → mailto:blog@theyan.gs" rel="noopener me" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/u/1494877243" title="Weibo → https:&#x2F;&#x2F;weibo.com&#x2F;u&#x2F;1494877243" rel="noopener me" target="_blank"><i class="fab fa-weibo fa-fw"></i>Weibo</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://twitter.com/6fool" title="Twitter → https:&#x2F;&#x2F;twitter.com&#x2F;6fool" rel="noopener me" target="_blank"><i class="fab fa-twitter fa-fw"></i>Twitter</a>
      </span>
  </div>

        </div>
      </div>
    </div>

    
    <div class="sidebar-inner sidebar-blogroll">
      <div class="links-of-blogroll animated">
        <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
          链接
        </div>
        <ul class="links-of-blogroll-list">
            <li class="links-of-blogroll-item">
              <a href="https://bad-pencil.github.io/" title="https:&#x2F;&#x2F;bad-pencil.github.io" rel="noopener" target="_blank">github 镜像站</a>
            </li>
            <li class="links-of-blogroll-item">
              <a href="https://hawhaw.gitee.io/" title="https:&#x2F;&#x2F;hawhaw.gitee.io" rel="noopener" target="_blank">gitee 镜像站</a>
            </li>
        </ul>
      </div>
    </div>
  </aside>


    </div>

    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ming.theyan.gs/2023/10/Chromebook%20%E5%AE%89%E8%A3%85%20Debian%2012%20testing/index.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="老杨">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="运维烂笔头">
      <meta itemprop="description" content="好记性比不过烂笔头">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="Chromebook 安装 Debian 12 testing | 运维烂笔头">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Chromebook 安装 Debian 12 testing
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2023-10-14 20:33:28" itemprop="dateCreated datePublished" datetime="2023-10-14T20:33:28+08:00">2023-10-14</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar-check"></i>
      </span>
      <span class="post-meta-item-text">更新于</span>
      <time title="修改时间：2023-10-27 19:46:53" itemprop="dateModified" datetime="2023-10-27T19:46:53+08:00">2023-10-27</time>
    </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody"><h2 id="缘起"><a href="#缘起" class="headerlink" title="缘起"></a>缘起</h2><p>本来这台 HP Chromebook 11A G6 EE( 加了一张 128G 的 TF 卡 )，我安装好了 Arch Linux(Xfce)，都弄好了的，但最近在知乎上老被安利说装 Debian 的 testing 版，于是我又开始折腾，把 Debian 13 testing(trixie) 安装到这台 Chromebook 上。</p>
<p>安装时，使用 lvm 分区不成功，系统报错：</p>
<blockquote>
<p>partman-lvm: pvcreate: error while loading shared libraries: libaio.so.1: cannot open shared object file: no such file or directory</p>
</blockquote>
<p>现在想想可能还有其他办法，比如想办法把这个需要的包注入进去，但当时选择了先用 ext4 分区安装系统自带的 16G 的卡里，装完以后再想办法转成 lvm 并把 TF 卡的空间加进来。</p>
<span id="more"></span>

<h2 id="具体步骤"><a href="#具体步骤" class="headerlink" title="具体步骤"></a>具体步骤</h2><h3 id="ext4-在自带存储上安装"><a href="#ext4-在自带存储上安装" class="headerlink" title="ext4 在自带存储上安装"></a>ext4 在自带存储上安装</h3><p>自带存储的设备号是：&#x2F;dev&#x2F;mmcblk1，容量只有 16G</p>
<p>这一步基本上没什么问题，我只讲一下最后自带存储的分区：</p>
<ul>
<li>分区 1，vfat 格式，挂在 &#x2F;boot&#x2F;efi</li>
<li>分区 2，ext4 格式，挂在 &#x2F;</li>
</ul>
<h3 id="将-迁移到-TF-卡（lvm）"><a href="#将-迁移到-TF-卡（lvm）" class="headerlink" title="将 &#x2F; 迁移到 TF 卡（lvm）"></a>将 &#x2F; 迁移到 TF 卡（lvm）</h3><p>这一步应该是重中之重，难度、复杂度都在这里。</p>
<h4 id="处理-TF-卡"><a href="#处理-TF-卡" class="headerlink" title="处理 TF 卡"></a>处理 TF 卡</h4><p>TF 卡的设备号是：&#x2F;dev&#x2F;mmcblk0，容量 128G</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">apt-get install lvm</span><br><span class="line"><span class="comment"># 系统原来没装 lvm</span></span><br><span class="line">wipefs -fa /dev/mmcblk0</span><br><span class="line"><span class="comment"># TF 卡上原来有数据，所以需要先 wipefs 干一下</span></span><br><span class="line">pvcreate /dev/mmcblk0</span><br><span class="line"><span class="comment"># 也可以先对设备分区了再创建 pv，但也可以直接在裸设备上做</span></span><br><span class="line">vgcreate vg_root /dev/mmcblk0</span><br><span class="line">lvcreate -L 116G -n lv_root vg_root</span><br><span class="line"><span class="comment"># TF 卡容量是 128G，可用为 116G 多一些，这里 lv 设 116G 大小，</span></span><br><span class="line"><span class="comment"># 其实多大没关系（因为 lv 是随时可以扩的），但只要小于可用的就行</span></span><br><span class="line">mkfs.ext4 /dev/vg_root/lv_root</span><br></pre></td></tr></table></figure>

<h4 id="迁移数据到-dev-vg-root-lv-root"><a href="#迁移数据到-dev-vg-root-lv-root" class="headerlink" title="迁移数据到 &#x2F;dev&#x2F;vg_root&#x2F;lv_root"></a>迁移数据到 &#x2F;dev&#x2F;vg_root&#x2F;lv_root</h4><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mkdir</span> /mnt/new_root</span><br><span class="line"><span class="comment"># 创建挂载点</span></span><br><span class="line">mount /dev/vg_root/lv_root /mnt/new_root</span><br><span class="line"><span class="comment"># 把新的根区挂载上</span></span><br><span class="line">tar -cvpf - --one-file-system --acls --xattrs \</span><br><span class="line">    --selinux / | tar -C /mnt/new_root -xf -</span><br><span class="line"><span class="comment"># 把数据倒到新的根区上</span></span><br><span class="line"><span class="built_in">cp</span> -aux /dev /mnt/new_root</span><br><span class="line"><span class="comment"># 把 /dev 下有更新的内容拷贝过来</span></span><br></pre></td></tr></table></figure>

<p>接着还要修改新根区下 etc&#x2F;fstab 的内容，将挂载在 &#x2F; 的设备改成 &#x2F;dev&#x2F;vg_root&#x2F;lv_root</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">vi /mnt/new_root/etc/fstab</span><br><span class="line"><span class="comment"># 这里之所以用 vi 而不是 vim 那是因为 vim 这个软件还尚未安装</span></span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">mount --<span class="built_in">bind</span> /dev /mnt/new_root/dev</span><br><span class="line"><span class="built_in">chroot</span> /mnt/new_root</span><br><span class="line">mount -t proc /proc /proc</span><br><span class="line">mount -t sysfs /sys /sys</span><br><span class="line">vgscan</span><br><span class="line">vgchange -ay</span><br><span class="line">mkinitramfs -o /boot/initrd-`<span class="built_in">uname</span> -r`.lvm.img `<span class="built_in">uname</span> -r`</span><br><span class="line"><span class="comment"># 上面这一步我感觉应该可以不做，因为上面 `apt-get install lvm`</span></span><br><span class="line"><span class="comment"># 时我貌似有看到重新制作 initrd 的 image 的情况，看吧，</span></span><br><span class="line"><span class="comment"># 这一句的目的是为了给 initrd 的 image 文件添加 lvm 的支持</span></span><br><span class="line"><span class="built_in">exit</span></span><br><span class="line"><span class="comment"># 退出 chroot 状态</span></span><br><span class="line"><span class="built_in">cp</span> /mnt/vg_root/lv_root/boot/initrd-`<span class="built_in">uname</span> -r`.lvm.img /boot</span><br><span class="line"><span class="comment"># 上面这一句我感觉其实也可以不做，因为老 / 区最终是要被干掉的呀</span></span><br></pre></td></tr></table></figure>

<p>最后的收尾工作：</p>
<ul>
<li>修改 &#x2F;mnt&#x2F;new_root&#x2F;boot&#x2F;grub&#x2F;grub.conf 的内容，最好新增一条 menuentry，内容拷贝原有的<ul>
<li>把显示的名字改了</li>
<li>把 initrd 的 image 文件改成前面新做成的 initrd 的 image 文件</li>
<li>如果还有涉及到 root 的 uuid 什么的，也要将原来的设备的 uuid 改成新 root 的设备 &#x2F;dev&#x2F;vg_root&#x2F;lv_root 的 uuid（命令 blkid 里可以看到，注意：有的设备有 UUID 还有 PARTUUID，一般来讲原来用的是哪个替换的时候也要用哪个替换，如果没有对应的，那么就用 UUID 来替换）</li>
</ul>
</li>
<li>修改文件 &#x2F;boot&#x2F;efi&#x2F;EFI&#x2F;debian&#x2F;grub.cfg，同样也是做 uuid 的替换</li>
</ul>
<p>最后，重启系统迁移这一步应该就好了</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">shutdown -r now</span><br></pre></td></tr></table></figure>

<h3 id="将自带存储加入新-区的-lv"><a href="#将自带存储加入新-区的-lv" class="headerlink" title="将自带存储加入新 &#x2F; 区的 lv"></a>将自带存储加入新 &#x2F; 区的 lv</h3><p>自带的存储的设备是：&#x2F;dev&#x2F;mmcblk1，老根区的设备号是：&#x2F;dev&#x2F;mmcblk1p2</p>
<p>电脑重新起来后，登录进去</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">wipefa -fa /dev/mmcblk1p2</span><br><span class="line">pvcreate /dev/mmcblk1p2</span><br><span class="line"><span class="comment"># 创建 pv(physical volume)</span></span><br><span class="line">vgextend vg_root /dev/mmcblk1p2</span><br><span class="line"><span class="comment"># 将老根分区所在存储加入到 vg_root 这个 vg（volume group） 里来</span></span><br><span class="line">lvextend -l +100%FREE /dev/vg_root/lv_root</span><br><span class="line"><span class="comment"># 将 lv_root 这个 lv(logical volume) 的大小扩展到所有未用空间</span></span><br><span class="line">resize2fs /dev/vg_root/lv_root</span><br><span class="line"><span class="comment"># 将 lv_root 这个 lv 上的 ext4 文件系统的大小扩展到整个 lv</span></span><br></pre></td></tr></table></figure>

<p>如此，便完成了。</p>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="reward-container">
  <div>请我一杯咖啡吧！</div>
  <button>
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/wechat-reward.png" alt="老杨 微信">
        <span>微信</span>
      </div>
      <div>
        <img src="/images/alipay-reward.png" alt="老杨 支付宝">
        <span>支付宝</span>
      </div>

  </div>
</div>

          <div class="followme">
  <span>欢迎关注我的其它发布渠道</span>

  <div class="social-list">

      <div class="social-item">
          <a target="_blank" class="social-link" href="https://twitter.com/6fool">
            <span class="icon">
              <i class="fab fa-twitter"></i>
            </span>

            <span class="label">Twitter</span>
          </a>
      </div>

      <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
      </div>
  </div>
</div>

          <div class="post-tags">
              <a href="/tags/Debian/" rel="tag"># Debian</a>
              <a href="/tags/trixie/" rel="tag"># trixie</a>
              <a href="/tags/Chromebook/" rel="tag"># Chromebook</a>
              <a href="/tags/testing/" rel="tag"># testing</a>
              <a href="/tags/lvm/" rel="tag"># lvm</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2023/09/%E7%9B%91%E6%8E%A7%20AWS%20%E7%9A%84%20RDS%20%E5%B9%B6%E9%80%9A%E8%BF%87%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%8A%A5%E8%AD%A6/index.html" rel="prev" title="监控 AWS 的 RDS 并通过企业微信来报警">
                  <i class="fa fa-angle-left"></i> 监控 AWS 的 RDS 并通过企业微信来报警
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2023/11/%E9%80%9A%E8%BF%87%E5%AE%9E%E6%97%B6%E7%9B%91%E6%8E%A7%E6%97%A5%E5%BF%97%E9%87%8C%E7%9A%84%E6%95%8F%E6%84%9F%E4%BF%A1%E6%81%AF%E6%9D%A5%E5%AE%9E%E7%8E%B0%E5%AF%B9%E5%BA%94%E7%94%A8%E7%9A%84%E7%9B%91%E6%8E%A7%E6%8A%A5%E8%AD%A6/index.html" rel="next" title="通过实时监控日志里的敏感信息来实现对应用的监控报警">
                  通过实时监控日志里的敏感信息来实现对应用的监控报警 <i class="fa fa-angle-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">

  <div class="copyright">
    &copy; 
    <span itemprop="copyrightYear">2025</span>
    <span class="with-love">
      <i class="fa fa-heart"></i>
    </span>
    <span class="author" itemprop="copyrightHolder">老杨</span>
  </div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>
  <div class="sidebar-dimmer"></div>
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up fa-lg"></i>
    <span>0%</span>
  </div>
  <a role="button" class="book-mark-link book-mark-link-fixed"></a>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>

</body>
</html>
